package com.wsc.personalblog.mapper;

import com.wsc.personalblog.entity.Role;
import com.wsc.personalblog.entity.RoleExample;
import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

@Repository
@Mapper
public interface RoleMapper {
    int countByExample(RoleExample example);

    int deleteByExample(RoleExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Role record);

    int insertSelective(Role record);

    List<Role> selectByExample(RoleExample example);

    Role selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Role record, @Param("example") RoleExample example);

    int updateByExample(@Param("record") Role record, @Param("example") RoleExample example);

    int updateByPrimaryKeySelective(Role record);

    int updateByPrimaryKey(Role record);

    List<Role> getRoleInfoByUserId(@Param("userId")Integer userId);

    List<Integer> getRoleIdByUserId(@Param("userId")Integer userId);

    void unbindRoleByUserId(@Param("userId")Integer userId);

    void saveRoleInfoByUserId(@Param("idList")List<Integer> idList, @Param("userId")Integer userId);

    Integer getUserBindInfoByRoleId(@Param("roleId")Integer roleId);

    void unbindAllUser(@Param("roleId")Integer roleId);
}